import type { FormSchema } from '@/components/core/schema-form/';

export const useFormSchema = (): FormSchema<any>[] => [
  {
    field: 'formid',
    component: 'Input',
    label: '表单ID',
    rules: [{ required: true, type: 'string' }],
  },
  {
    field: 'formRef',
    component: 'Input',
    label: '表单名称',
    rules: [{ required: true, type: 'string' }],
  },
  {
    field: 'tableName',
    component: 'Input',
    label: '存储表名',
    rules: [{ required: true, type: 'string' }],
  },
  {
    field: 'formSort',
    component: 'TreeSelect',
    label: '表单分类',
    componentProps: {
      fieldNames: {
        label: 'name',
        value: 'id',
      },
      getPopupContainer: () => document.body,
    },
    rules: [{ required: false, type: 'string' }],
  },
];
